/*****************************************************************
myd engine v0.1

File: myd_vertexbuffer.h
Created: 26/05/09
*****************************************************************/

#ifndef MYD_VERTEX_BUFFER_H
#define MYD_VERTEX_BUFFER_H

#include <windows.h>
#include <d3d9.h>
#include <assert.h>
#include "system/myd_system.h"

namespace myd
{
	template<class VertexFormat, unsigned int FVF>

	class Vertexbuffer
	{
		public:
			typedef boost::shared_ptr< Vertexbuffer<VertexFormat, FVF> > Ptr;

		 public:
			Vertexbuffer(unsigned int count);
			~Vertexbuffer(void);

			void setVertex(unsigned int index, const VertexFormat& v);
			const VertexFormat& getVertex(unsigned int index) const;
			VertexFormat& getVertex(unsigned int index);

			const VertexFormat* getVertices() const;

			size_t getVertexCount () const;
			
			unsigned int getId() const;

		 private:
			std::vector<VertexFormat> vertices;
			unsigned int uiId;
			static unsigned int currentId;
	};

	#include "myd_vertexbuffer.inl"
}
#endif // MYD_VERTEX_BUFFER_H_